home *** CD-ROM | disk | FTP | other *** search
/ 9-Digit Zip Code Directory / 9-Digit Zip Code Directory (American Business Information) (ABIZIP-12).ISO / z4src.zip / VXTT.HPP < prev    next >
C/C++ Source or Header  |  1993-08-24  |  4KB  |  114 lines

  1. //----------------------------------------------------------------------------
  2. //                            MODULE DESCRIPTION
  3. //
  4. //  Module:    class.hpp
  5. //   Title:    C++ Class Libraries
  6. //  Notice:    John M. Weeder
  7. //                 Copyright (c) 1993. All rights reserved.
  8. //             This module contains proprietary information and should be 
  9. //                treated as confidential.
  10. //
  11. //----------------------------------------------------------------------------
  12. //                           MAINTENANCE HISTORY
  13. //
  14. // $Workfile$
  15. // $Revision$
  16. //   $Author$
  17. //     $Date$
  18. //      $Log$    
  19. //
  20. //----------------------------------------------------------------------------
  21. //                             MODULE NARRATIVE
  22. //
  23. //    This module contains code for the class VX_TT.
  24. //
  25. //    The code in this module may be written in C++ or C.
  26. //
  27. //    This module is portable to:
  28. //        DOS 3.X+
  29. //        MS Windows 3.X+
  30. //        OS/2 2.X+
  31. //        OS/2 2.0 PM
  32. //
  33. //    The following compilers are supported:
  34. //        MSC 6.0A
  35. //        MSC/C++ 7.0
  36. //        Borland C++ 3.1 for DOS
  37. //        Borland C++ 1.0 for OS/2 2.X
  38. //
  39. //----------------------------------------------------------------------------
  40.  
  41.  
  42. //----------------------------------------------------------------------------
  43. //    Constants
  44. //----------------------------------------------------------------------------
  45. #define VX_TT_MAX            (20)                // Maximum allowed TT characters
  46.  
  47. #define VX_TT_ALL       (0x03FF)          // All characters 
  48. #define VX_TT_0         (0x0001)          // Indivually allowed characters 
  49. #define VX_TT_1         (0x0002)
  50. #define VX_TT_2         (0x0004)
  51. #define VX_TT_3         (0x0008)
  52. #define VX_TT_4         (0x0010)
  53. #define VX_TT_5         (0x0020)
  54. #define VX_TT_6         (0x0040)
  55. #define VX_TT_7         (0x0080)
  56. #define VX_TT_8         (0x0100)
  57. #define VX_TT_9         (0x0200)
  58. #define VX_TT_POUND     (0x0400)
  59. #define VX_TT_STAR      (0x0800)
  60.  
  61. enum VX_TT_STATUS
  62.     {
  63.     VX_TT_SUCCESS = 0,                        // Success
  64.     VX_TT_FAIL,                                    // Query failed
  65.     VX_TT_STOP,                                    // User request abort!
  66.     VX_TT_TIMEOUT,                                // Request timed out
  67.     VX_TT_DEFAULT,                                // User did not enter anything
  68.     VX_TT_INVALID,                                // Invalid entry or too short
  69.     };
  70.  
  71.  
  72. //----------------------------------------------------------------------------
  73. //    Class VX_TT
  74. //----------------------------------------------------------------------------
  75. CLASSDEF(VX_TT);
  76. #define VX_TT_PARENT VX_VOX
  77. class CLASSTYPE VX_TT : public VX_TT_PARENT
  78. {
  79.     CHAR szBuf[VX_TT_MAX+1];                // Buffer for characters
  80.     VX_TT_STATUS status;                        // Status of last query
  81.     FLAG16 fs;                                    // Flags
  82.     SIZET cMin;                                    // Minimum number of characters
  83.     SIZET cMax;                                    // Maximum number of characters
  84.  
  85. public:
  86.     FN_M VX_TT();
  87.     FN_M VX_TT(RCVX_TT);
  88.     virtual FN_M ~VX_TT();
  89.  
  90.     virtual BOOL FN_M Destroy(BOOL = TRUE);
  91.     virtual BOOL FN_M Initialize(SHORT = CL_INIT_ALL);
  92.     RCVX_TT FN_M operator=(RCVX_TT);
  93.     FN_M operator PCSZ() const
  94.         {
  95.         return (PCSZ)szBuf;
  96.         }
  97.     FN_M operator PSZ() const
  98.         {
  99.         return (PSZ)szBuf;
  100.         }
  101.     VX_TT_STATUS FN_M Query(BOOL = FALSE);
  102.     virtual BOOL FN_M Retrieve(PCSZ, PCSZ = NULL);
  103.     VX_TT_STATUS FN_M Status()
  104.         {
  105.         return status;
  106.         }
  107.     FLAG16 FN_M SetFlags(FLAG16 = VX_TT_ALL);
  108.     BOOL FN_M SetLength(SIZET = 1, SIZET = VX_TT_MAX);
  109.     virtual BOOL FN_M Store(PCSZ, PCSZ = NULL);
  110. };
  111. //----------------------------------------------------------------------------
  112. //------------------------------- End of File --------------------------------
  113. //----------------------------------------------------------------------------
  114.